package cn.tedu.tmall.common.exception;

import cn.tedu.tmall.common.web.ServiceCode;

/**
 * 自定义业务异常
 */
public class ServiceException extends RuntimeException{
    /**
     * 自定义异常包含异常状态码和异常信息
     */
    private Integer serviceCode;

    public ServiceException(Integer serviceCode, String message ){
        super(message);
        this.serviceCode = serviceCode;
    }

    public ServiceException(ServiceCode serviceCode){
        super(serviceCode.getMsg());
        this.serviceCode = serviceCode.getCode();
    }
}
